<template>
  <div v-for="(item) in data">
    <input type="checkbox" v-model="item.checked"><span>{{ item.name }}</span>
    <xiaman :data="item?.children" v-if="item?.children?.length>0"></xiaman>
  </div>
</template>
<script lang="ts">
export default {
 name:'xiaman'
}
</script>

<script setup lang="ts">
import { defineProps } from "vue";
interface Tree {
  name:string,
  checked:boolean,
  children?:Tree[]
}
const prop=defineProps<{
  data?:Tree[]
}>()
console.log('----',prop)
</script>

<style>

</style>